Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

658
Visualizações
Why getStaticProps giving error of "Failed to load SWC binary for win32/x64"?

I am using getStaticProps() in a Next.js app but when I run the app it gives ERROR:-

warn  - Attempted to load @next/swc-win32-x64-gnu, but it was not installed
warn  - Attempted to load @next/swc-win32-x64-msvc, but an error occurred: The specified 
module could not be found.
\\?\D:\tasks\next-js\node_modules\@next\swc-win32-x64-msvc\next-swc.win32-x64-msvc.node
error - Failed to load SWC binary for win32/x64, see more info here: 
https://nextjs.org/docs/messages/failed-loading-swc
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! next-js@0.1.0 dev: `next dev`
npm ERR! Exit status 1
npm ERR!

I tried all methods like uninstalling node_module, package-lock and reinstalling it. I tried adding .babelrc file, also added swcMinify: false in next.config but nothing works.
When I use useEffect instead of getStaticProps then it works fine. Here is the getStaticProps function:-

export const getStaticProps = async () =>{

const res = await fetch('https://jsonplaceholder.typicode.com/posts');
const data = await res.json();

return{
    props: {
        data,
    }
  };
};
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This issue appears when running next@12.1.6 and happens even if your .babelrc file and next.config.js files are configured to not load swc.

If you downgrade to next@12.1.0, the swc binary load error should go away.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda